import Vue from 'vue'
import Router from 'vue-router'
import login from '@/components/login'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: 'login'
    },
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/home',
      name: 'home',
      component: resolve => require(['@/components/home'], resolve),
      redirect: {name: 'index'},
      children: [
        {
          path: 'index',
          name: 'index',
          component: resolve => require(['@/pages/index'], resolve)
        },
        {
          // 主统计项详情
          path: 'statisdetail',
          name: 'statisdetail',
          component: resolve => require(['@/pages/statistics/statisdetail'], resolve)
        },
        {
          // 具体活动统计事项
          path: 'activityEvent',
          name: 'activityEvent',
          component: resolve => require(['@/pages/statistics/activtyEvent'], resolve)
        },
        { // 管理员列表
          path: 'adminlist',
          name: 'adminlist',
          component: resolve => require(['@/pages/adminmistor/adminlist'], resolve)
        },
        { // 管理员列表
          path: 'admindetail',
          name: 'admindetail',
          component: resolve => require(['@/pages/adminmistor/admindetail'], resolve)
        },
        { // 活动类型
          path: 'activityType',
          name: 'activityType',
          component: resolve => require(['@/pages/adminmistor/activityType'], resolve)
        },
        { // 权限管理
          path: 'authManage',
          name: 'authManage',
          component: resolve => require(['@/pages/adminmistor/authManage'], resolve)
        },
        { // 活动管理列表
          path: 'activitymanage',
          name: 'activitymanage',
          component: resolve => require(['@/pages/activitymanage/activityManage'], resolve)
        },
        { // 添加活动
          path: 'addActivity',
          name: 'addActivity',
          component: resolve => require(['@/pages/activitymanage/addActivity'], resolve)
        },
        { // 查看活动
          path: 'viewActivity',
          name: 'viewActivity',
          component: resolve => require(['@/pages/activitymanage/viewActivity'], resolve)
        },
        { // 用户管理
          path: 'userManage',
          name: 'userManage',
          component: resolve => require(['@/pages/usermanage/usermanage'], resolve)
        },
        { // 查看用户
          path: 'viewUserInfo',
          name: 'viewUserInfo',
          component: resolve => require(['@/pages/usermanage/viewUserInfo'], resolve)
        },
        { // 活动日程维护
          path: 'activityDayList',
          name: 'activityDayList',
          component: resolve => require(['@/pages/activitymanage/activityDayList'], resolve)
        },
        { // 活动日程详情
          path: 'activityDayDetail',
          name: 'activityDayDetail',
          component: resolve => require(['@/pages/activitymanage/activityDayDetail'], resolve)
        },
        { // 报名人列表
          path: 'signpeople',
          name: 'signpeople',
          component: resolve => require(['@/pages/activitymanage/signpeople'], resolve)
        },
        { // 活动评论列表
          path: 'activityComment',
          name: 'activityComment',
          component: resolve => require(['@/pages/activitymanage/activityComment'], resolve)
        }
      ]
    }
  ]
})
